﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UCL.Powersource.Analysis;

namespace UCL.Powersource.Mock
{

    [Export(typeof(IStatistic))]
    public class DummyStatistic1 : StatisticTeamBase
    {
        public DummyStatistic1()
            : base()
        {
            r = new Random(1);
        }

        public override string Label
        {
            get { return "Dummy statistic 1"; }
        }

        public override string Description
        {
            get { return "Dummy statistic description"; }
        }

        public override string Name
        {
            get { return "DummyStatistic1"; }
        }

        public static readonly Guid CN_Statistic_Guid = new Guid("72E61A96-61D7-49CA-8FC3-EA33205D0662");
        public override Guid Statistic_Guid
        {
            get { return CN_Statistic_Guid; }
        }

        private Random r;

        protected override double? CalculateFor(ITfsTeamProjectConfiguration teamProjConfig, ITimeFrame timeFrame)
        {
            //Compute statistic here!
            return 75 * r.NextDouble();
        }

        public override bool RequiresBuild
        {
            get { return false; }
        }
    }

    [Export(typeof(IStatistic))]
    public class DummyStatistic2 : StatisticCompareTeamsBase
    {
        public DummyStatistic2()
            : base()
        {
            r = new Random(2);
        }

        public override string Label
        {
            get { return "Dummy statistic 2"; }
        }

        public override string Description
        {
            get { return "Dummy statistic 2 description"; }
        }

        public override string Name
        {
            get { return "DummyStatistic2"; }
        }

        public static readonly Guid CN_Statistic_Guid = new Guid("1A542C31-4992-4E25-B51C-B27C8D351E67");
        public override Guid Statistic_Guid
        {
            get { return CN_Statistic_Guid; }
        }

        private Random r;

        protected override double? CalculateFor(ITfsTeamProjectConfiguration teamProjConfig, ITimeFrame timeFrame, ITfsTeamProjectConfiguration teamProjConfig2, ITimeFrame timeFrame2)
        {
            return 5 * r.NextDouble();
        }
        public override bool RequiresBuild
        {
            get { return false; }
        }
    }

}
